package com.sugon.dao;

import com.sugon.entity.DevMaintenancePlanItemEntity;
import com.sugon.modules.device.model.DevMaintenPlanItemVO;
import com.sugon.modules.device.model.vo.DevMaintenancePlanDeviceVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 设备维护计划项信息Dao
 *
 * @author sugon
 * @date 2020-07-26 20:00:49
 */
public interface DevMaintenancePlanItemDao extends BaseDao<DevMaintenancePlanItemEntity> {

    /**
     * 查询设备维护计划项明细
     *
     * @param map 查询参数
     * @return
     */
    List<DevMaintenancePlanDeviceVO> queryDevMaintenancePlanItemDetails(Map<String, Object> map);

    List<DevMaintenPlanItemVO> queryList2(Map<String, Object> map);

    /**
     * 获取某设备指定年度的维护计划项列表
     *
     * @param devId  设备ID
     * @param yearly 年度
     * @return
     */
    List<DevMaintenancePlanItemEntity> getYearlyPlanItemByDevId(@Param("devId") String devId, @Param("yearly") Integer yearly);

    /**
     * 删除设备维护计划项
     * @param planId 维护计划ID
     * @param devId 设备ID
     * @param mainBaseIdList 设备维护项ID列表
     * @return
     */
    int deletePlanItem(@Param("planId") String planId, @Param("devId") String devId, @Param("mainBaseIdList") List<String> mainBaseIdList);

    /**
     * 根据设备维护计划ID和维护项ID
     *
     * @param planIdList 维护计划ID列表
     * @param mainBaseId 设备维护项ID
     * @return
     */
    int deleteByPlanIdAndMainBaseId(@Param("planIdList") List<String> planIdList, @Param("mainBaseId") String mainBaseId);

}
